import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { fileURLToPath } from "node:url";
import { viteMockServe } from "vite-plugin-mock";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    viteMockServe({
      mockPath: "./mock/", // 设置模拟数据的存储文件夹
      supportTs: true, // 是否读取ts文件模块
      logger: true, //  是否在控制台显示请求日志
      localEnabled: true, //设置是否启用本地mock文件
      prodEnabled: true, //设置打包是否启用 mock 功能
    }),
  ],
  server: {
    port: 3000,
  },
  resolve: {
    alias: {
      "@": fileURLToPath(new URL("./src", import.meta.url)),
    },
  },
});
